<{*下拉菜单样式*}>
<link rel="stylesheet" href="<{$template_dir}>admin/css/select2.css" />
<script src="<{$template_dir}>admin/js/jquery.uniform.js"></script> 
<script src="<{$template_dir}>admin/js/select2.min.js"></script> 
<script src="<{$template_dir}>admin/js/61.select.1.js"></script> 

<!--<link rel="stylesheet" href="<{$template_dir}>admin/css/tree/css/demo.css" type="text/css">
-->
<link rel="stylesheet" href="<{$template_dir}>admin/css/tree/css/zTreeStyle/zTreeStyle.css" type="text/css">
<script type="text/javascript" src="<{$template_dir}>admin/css/tree/js/jquery-1.4.4.min.js"></script> 
<script type="text/javascript" src="<{$template_dir}>admin/css/tree/js/jquery.ztree.core-3.5.js"></script> 
<!--  <script type="text/javascript" src="../../../js/jquery.ztree.excheck-3.5.js"></script>
<script type="text/javascript" src="../../../js/jquery.ztree.exedit-3.5.js"></script>--> 
<SCRIPT type="text/javascript">
	    var jQuery_1_4_4 = $.noConflict(true);


		<!--
		var setting = {
			
			data: {
				simpleData: {
					enable: true
				}
			}
		
		};
		
		

		var zNodes =[
			
			<{section name=list loop=$datas}>
			{ id:<{$datas[list].id}>, pId:<{$datas[list].pid}>, name:"[id:<{$datas[list].id}>]<{$datas[list].title}><{if $datas[list].status==2}>[禁用]<{/if}>" ,open:true,url:"index.php?m=admin&t=menu&id=<{$datas[list].id}>",target:"_top"<{if $datas[list].status==2}>,font:{'color':'red'}<{/if}>}<{if !$smarty.section.list.last}>,<{/if}>
			<{/section}>
		];
		

		jQuery_1_4_4(document).ready(function(){
			 jQuery_1_4_4.fn.zTree.init(jQuery_1_4_4("#treeDemo"), setting, zNodes);
			
		});
		
		$(function(){
			
			$('#delete').click(function(){
				if (confirm('您确定要删除？')){
					 location.href="index.php?m=admin&t=delMenu&id=<{$gvar.fget.id}>";
				}
			})
		})
		//-->
	</SCRIPT>
<div id="content">
  <div id="content-header">
    <div id="breadcrumb"> <a href="?m=admin&t=main" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> 后台首页</a> <a href="#" class="tip-bottom">系统设定</a> <a href="#" class="current">前台菜单管理</a> </div>
  </div>
  <div class="container-fluid">
    <hr>
     <{if $gvar.fget.id}>
     <div class="row-fluid">
     	<div class="span12">
        	<div class="widget-box">
            <div class="widget-title"> <span class="icon"> <i class="icon-hand-right"></i> </span>
              <h5>操作</h5>
            </div>
            	<div class="widget-content"> <a href="?m=admin&o=core&t=menu" data-toggle="modal" class="btn btn-success">增加新菜单</a> 
            </div>
      </div>
        </div>
     </div>
     <{/if}>
    <div class="row-fluid">
      <div class="span6">
        <div class="widget-box">
          <div class="widget-title"> <span class="icon"> <i class="icon-align-justify"></i> </span>
            <h5>前台菜单管理</h5>
          </div>
          <div class="widget-content nopadding">
            <div class="zTreeDemoBackground left">
              <ul id="treeDemo" class="ztree">
              </ul>
            </div>
          </div>
        </div>
      </div>
      <div class="span6">
        <div class="widget-box">
          <div class="widget-title"> <span class="icon"> <i class="icon-align-justify"></i> </span>
            <h5>菜单设置</h5>
          </div>
          <div class="widget-content nopadding">
            <form action="index.php?m=admin&t=saveMenu&id=<{$gvar.fget.id}>" method="post" class="form-horizontal" enctype="multipart/form-data">
              <div class="controls">
                  <select name="pid">
                    <option value="0">根频道</option>
                    <{section name=list loop=$bread_class}> 
                    <option value="<{$bread_class[list].id}>" <{if $bread_class[list].id==$data.pid}>selected="selected"<{/if}>>
                    
                    	<{section name="left" loop=$bread_class[list].lv}>
                         
                        <{if $smarty.section.left.last}>└<{else}>　<{/if}>
                        <{/section}>
                        
                    <{$bread_class[list].title}></option>
                    <{/section}>
                  </select>
                </div>
              <div class="control-group">
                <label for="checkboxes" class="control-label">菜单标题</label>
                <div class="controls">
                  <input id="title" type="text" class="span10" name="title" value="<{$data.title}>"/>
                </div>
              </div>
              <div class="control-group">
                <label for="checkboxes" class="control-label">连接URL</label>
                <div class="controls">
                  <input id="url" type="text" class="span10" name="url" value="<{$data.url}>"/>
                </div>
              </div>
                <div class="control-group">
                <label for="checkboxes" class="control-label">样式名称</label>
                <div class="controls">
                  <input id="class_name" type="text" class="span10" name="class_name" value="<{$data.class_name}>"/>
                </div>
              </div>
              <div class="control-group">
                <label for="checkboxes" class="control-label">菜单图片</label>
                <div class="controls">
                  <input type="file" name="menu_photo" class="file"/>  
                </div>
              </div>
              <{if $data.menu_photo}>
                <div class="control-group">
                  <label class="control-label">图片预览</label>
                  <div class="controls">
					<a target="_blank" href="<{$data.menu_photo}>" ><img src="<{$data.menu_photo}>"></a>     
                  </div>
                </div>
                <{/if}>
                            <div class="control-group">
                <label for="checkboxes" class="control-label">切换图片</label>
                <div class="controls">
                  <input type="file" name="menu_hover" class="file"/>  
                </div>
              </div>
              <{if $data.menu_hover}>
                <div class="control-group">
                  <label class="control-label">图片预览</label>
                  <div class="controls">
					<a target="_blank" href="<{$data.menu_hover}>" ><img src="<{$data.menu_hover}>"></a>     
                  </div>
                </div>
                <{/if}>
              <div class="control-group">
                <label for="checkboxes" class="control-label">排序</label>
                <div class="controls">
                  <input id="sort" type="text" name="sort" value="<{$data.sort|default:0}>"/>
                </div>
              </div>
              
                <div class="control-group">
                <label for="checkboxes" class="control-label">方式</label>
                <div class="controls">
                <label> <input name="target" type="radio" value="_top" <{if $data.target=="_top" || !$data.target}>checked="checked"<{/if}>/>默认</label>
                <label> <input name="target" type="radio" value="_blank" <{if $data.target=="_blank"}>checked="checked"<{/if}>/>弹出</label>
                </div>
              </div>
              
              <div class="control-group">
                <label class="control-label">启用状态</label>
                <div class="controls">
                  <label> <input type="radio" name="status" value="1" <{if $data.status==1 || !$data.status}>checked="checked"<{/if}>/>
                    开启</label>
                  <label> <input type="radio" name="status" value="2" <{if $data.status==2}>checked="checked"<{/if}>/>
                    关闭</label>
                </div>
              </div>

              <div class="form-actions">
                <button type="submit" class="btn btn-success">保存</button>
                <{if $gvar.fget.id}>
                <button type="button" id="delete" class="btn btn-success">删除</button>
                <{/if}>
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
